<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>然之系统自动化测试报告</title>
    <meta name="generator" content="HtmlTestRunner 0.8.4"/>
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">

    <style type="text/css" media="screen">

.img{
	height: 100%;
	border-collapse: collapse;
    border: 2px solid #777;
}

.screenshots {
    z-index: 100;
	position:absolute;
	height: 80%;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
	display: none;
}

.imgyuan{
    height: 20px;
    border-radius: 12px;
    background-color: red;
    padding-left: 13px;
    margin: 0 auto;
    position: relative;
    top: -40px;
    background-color: rgba(1, 150, 0, 0.3);
}
.imgyuan font{
    border:1px solid white;
    width:11px; 
    height:11px;
    border-radius:50%;
    margin-right: 9px;
    margin-top: 4px;
    display: block;
    float: left;
    background-color: white;
}
.close_shots {
    background-image: url();
    background-size: 22px 22px;
    -moz-background-size: 22px 22px;
    background-repeat: no-repeat;
    position: absolute;
    top: 5px;
    right: 5px;
    height: 22px;
    z-index: 99;
    width: 22px;
}


/* -- css div popup ------------------------------------------------------------------------ */
.popup_window {
    display: none;
    position: relative;
    left: 0px;
    top: 0px;
    /*border: solid #627173 1px; */
    padding: 10px;
    background-color: #99CCFF;
    font-family: "Lucida Console", "Courier New", Courier, monospace;
    text-align: left;
    font-size: 10pt;
    width: 500px;
}

/* -- report ------------------------------------------------------------------------ */

#show_detail_line .label {
    font-size: 85%;
    cursor: pointer;
}

#show_detail_line {
    margin: 2em auto 1em auto;
}

#total_row  { font-weight: bold; }
.hiddenRow  { display: none; }
.testcase   { margin-left: 2em; }


    </style>


    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<script language="javascript" type="text/javascript"><!--
output_list = Array();

/* level - 0:Summary; 1:Failed; 2:All */
function showCase(level) {
    trs = document.getElementsByTagName("tr");
    for (var i = 0; i < trs.length; i++) {
        tr = trs[i];
        id = tr.id;
        if (id.substr(0,2) == 'ft') {
            if (level < 1) {
                tr.className = 'hiddenRow';
            }
            else {
                tr.className = '';
            }
        }
        if (id.substr(0,2) == 'pt') {
            if (level > 1) {
                tr.className = '';
            }
            else {
                tr.className = 'hiddenRow';
            }
        }
    }
}


function showClassDetail(cid, count) {
    var id_list = Array(count);
    var toHide = 1;
    for (var i = 0; i < count; i++) {
        tid0 = 't' + cid.substr(1) + '.' + (i+1);
        tid = 'f' + tid0;
        tr = document.getElementById(tid);
        if (!tr) {
            tid = 'p' + tid0;
            tr = document.getElementById(tid);
        }
        id_list[i] = tid;
        if (tr.className) {
            toHide = 0;
        }
    }
    for (var i = 0; i < count; i++) {
        tid = id_list[i];
        if (toHide) {
            document.getElementById('div_'+tid).style.display = 'none'
            document.getElementById(tid).className = 'hiddenRow';
        }
        else {
            document.getElementById(tid).className = '';
        }
    }
}


function showTestDetail(div_id){
    var details_div = document.getElementById(div_id)
    var displayState = details_div.style.display
    // alert(displayState)
    if (displayState != 'block' ) {
        displayState = 'block'
        details_div.style.display = 'block'
    }
    else {
        details_div.style.display = 'none'
    }
}


function html_escape(s) {
    s = s.replace(/&/g,'&amp;');
    s = s.replace(/</g,'&lt;');
    s = s.replace(/>/g,'&gt;');
    return s;
}

function show_img(obj) {
    var obj1 = obj.nextElementSibling
    obj1.style.display='block'
    var index = 0;//每张图片的下标，
    var len = obj1.getElementsByTagName('img').length;
    var imgyuan = obj1.getElementsByClassName('imgyuan')[0]
    //var start=setInterval(autoPlay,500);
    obj1.onmouseover=function(){//当鼠标光标停在图片上，则停止轮播
        clearInterval(start);
    }
    obj1.onmouseout=function(){//当鼠标光标停在图片上，则开始轮播
        start=setInterval(autoPlay,1000);
    }    
    for (var i = 0; i < len; i++) {
        var font = document.createElement('font')
        imgyuan.appendChild(font)
    }
    var lis = obj1.getElementsByTagName('font');//得到所有圆圈
    changeImg(0)
    var funny = function (i) {
        lis[i].onmouseover = function () {
            index=i
            changeImg(i)
        }
    }
    for (var i = 0; i < lis.length; i++) {
        funny(i);
    }

    function autoPlay(){
        if(index>len-1){
            index=0;
            clearInterval(start); //运行一轮后停止
        }
        changeImg(index++);
    }
    imgyuan.style.width= 25*len +"px";
    //对应圆圈和图片同步
    function changeImg(index) {
        var list = obj1.getElementsByTagName('img');
        var list1 = obj1.getElementsByTagName('font');
        for (i = 0; i < list.length; i++) {
            list[i].style.display = 'none';
            list1[i].style.backgroundColor = 'white';
        }
        list[index].style.display = 'block';
        list1[index].style.backgroundColor = 'blue';
    }

}
function hide_img(obj){
    obj.parentElement.style.display = "none";
    obj.parentElement.getElementsByClassName('imgyuan')[0].innerHTML = "";
}

/* obsoleted by detail in <div>
function showOutput(id, name) {
    var w = window.open("", //url
                    name,
                    "resizable,scrollbars,status,width=800,height=450");
    d = w.document;
    d.write("<pre>");
    d.write(html_escape(output_list[id]));
    d.write("\n");
    d.write("<a href='javascript:window.close()'>close</a>\n");
    d.write("</pre>\n");
    d.close();
}
*/
-->
</script>

<div class="container">
    <div class='heading'>
        <h1>然之系统自动化测试报告</h1>
        <p><strong>Start Time 开始时间:</strong> 2018-08-02 18:58:48</p>
        <p><strong>Duration 用时:</strong> 0:00:12.630776</p>
        <p><strong>Status 状态:</strong> <span class="text text-warning">Error <strong>1</strong></span></p>

        <p class='description'>具体测试报告内容如下: </p>
    </div>


    <p id='show_detail_line'>
        <span class="label label-primary" onclick="showCase(0)">Summary</span>
        <span class="label label-danger" onclick="showCase(1)">Failed</span>
        <span class="label label-default" onclick="showCase(2)">All</span>
    </p>
    <table id='result_table' class="table">
        <thead>
        <tr id='header_row'>
            <th>Test Suite/Test Case 测试套件/用例
            </td>
            <th>Count 个数
            </td>
            <th>Pass 通过
            </td>
            <th>Fail 不通过
            </td>
            <th>Error 测试程序异常
            </td>
            <th>View 查看
            </td>
        </tr>
        </thead>
        <tbody>

        <tr class='text text-warning'>
            <td>case.ranzhi_test.RanzhiTest</td>
            <td>1</td>
            <td>0</td>
            <td>0</td>
            <td>1</td>
            <td><a class="btn btn-xs btn-primary" href="javascript:showClassDetail('c1',1)">Detail 详情</a></td>
        </tr>

        <tr id='ft1.1' class='text text-success'>
            <td class='text text-warning'>
                <div class='testcase'>test_02: 测试选择 app</div>
            </td>
            <td colspan='4' align='center'>

                <!--css div popup start-->
                <a class="popup_link btn btn-xs btn-default" onfocus='this.blur();'
                   href="javascript:showTestDetail('div_ft1.1')">
                    error</a>

                <div id='div_ft1.1' class="popup_window">
                    <div style='text-align: right;cursor:pointer'>
                        <a onfocus='this.blur();'
                           onclick="document.getElementById('div_ft1.1').style.display = 'none' ">
                            [x]</a>
                    </div>
                    <pre>
            
ft1.1: [2018-08-02 18:58:48,476]-[box.py]-[INFO]: 开始测试前置条件
[2018-08-02 18:58:53,878]-[box.py]-[INFO]: 完成测试前置条件
[2018-08-02 18:58:53,880]-[box.py]-[INFO]: [RanzhiTest]开始 test_02
start
[2018-08-02 18:59:01,103]-[box.py]-[ERROR]: 测试用例执行异常：(&lt;class 'AttributeError'&gt;, AttributeError("'NoneType' object has no attribute 'type'",), &lt;traceback object at 0x000001AAA77759C8&gt;)
Traceback (most recent call last):
  File "C:\Git\hat\base\box.py", line 995, in testPartExecutor
    yield
  File "C:\Git\hat\base\box.py", line 907, in run
    testMethod()
  File "C:\Git\hat\case\ranzhi_test.py", line 118, in test_02
    self.main_page.input_login_info("admin", "123456")
  File "C:\Git\hat\biz\ranzhi\login_page.py", line 15, in input_login_info
    self.driver.type(self.config_dict["LOGIN_FORM_ACCOUNT_SELECTOR"], account)
AttributeError: 'NoneType' object has no attribute 'type'


            </pre>
                </div>
                <!--css div popup end-->

            </td>
            <td colspan='1' align='center'>
                <a href="#" onclick="show_img(this)">Snapshot 截图</a>
                <div align="center" class="screenshots" style="display:none">
                    <a class="close_shots" href="#" onclick="hide_img(this)"></a>
                    <img src=""
                         style="display: block;" class="img"/>

                    <div class="imgyuan"></div>
                </div>
            </td>
        </tr>

        </tbody>
        <tfoot>
        <tr id='total_row'>
            <td>Total 总共</td>
            <td>1</td>
            <td class="text text-success">0</td>
            <td class="text text-danger">0</td>
            <td class="text text-warning">1</td>
            <td>&nbsp;</td>
        </tr>
        </tfoot>
    </table>

    <div id='ending'>&nbsp;</div>
</div>

</body>
</html>
